package com.learn.configuration;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Swagger3Configuration {
    @Bean
    public OpenAPI openAPI() {
        OpenAPI openAPI = new OpenAPI();
        
        openAPI.info(
                new Info().title("自定义标题")
                        .description("自定义描述")
                        .version("自定义版本号")
        );
        
        openAPI.externalDocs(
                new ExternalDocumentation()
                        .description("自定义其他文档")
                        .url("https://www.baidu.com")
        );
        
        return openAPI;
    }
}
